clear;
clf;
n=1024;

figure('units', 'normalized', 'position', [0, 0, 0.25, 0.5]);
axis off;
axis([-10, n+n/8, -1.2, 1.2])
w = [1/3, 1/2, 2/3, 1];
hold on;
plot([0, n+n/8], [0,0], '-k');
plot([n/2, n/2], [-0.01, 0.01], '-k');
plot([n, n], [-0.01, 0.01], '-k');
plot([0, 0], [-1.2, 1.2], '-k');
plot([-5, 5], [-1, -1], '-k');
plot([-5, 5], [1, 1], '-k');
text(n+n/8, -0.05, 'k', 'Fontsize', 15, 'color', 'k');
text(n/2-20, -0.05, 'n/2', 'Fontsize', 15, 'color', 'k');
text(n, -0.05, 'n', 'Fontsize', 15, 'color', 'k');
text(-40, -1, '-1', 'Fontsize', 15, 'color', 'k');
text(-20, 1, '1', 'Fontsize', 15, 'color', 'k');
text(-90, 1.2, '\lambda_k(T_\omega)', 'Fontsize', 15, 'color', 'k');
text(1010, 0.38, '\omega=1/3', 'Fontsize', 15, 'color', 'k');
text(1010, 0.05, '\omega=1/2', 'Fontsize', 15, 'color', 'k');
text(1010, -0.30, '\omega=2/3', 'Fontsize', 15, 'color', 'k');
text(1010, -0.95, '\omega=1', 'Fontsize', 15, 'color', 'k');
K = 0:1:n;
for i = 1:4;
    for k = 0:n;
        x(i, k+1) = 1-2*w(i)*(sin(k*pi/2/n))^2;
    end
    plot(K, x(i,:), '-');
end
print(gcf,'-depsc', '../Exercise9_25.eps');